home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / CM1_TUT.TXT < prev    next >
Encoding:
Text File  |  1996-01-01  |  4.2 KB  |  99 lines

  1. Tutorial for c4a Crackme #1
  2. ---------------------------
  3.  
  4. Written by Prophecy [tNO '98] on 5th August 1998.
  5. -------------------------------------------------
  6.  
  7. [Note if there are things you don't quite understand email me at
  8. prophecy_@usa.net or catch me in EFNET in #cracking4newbies or #tno.]
  9.  
  10. Well it become apparent very soon that this was a Visual Bullshit crackme,
  11. which crashed SmartCheck btw.  You can do a bpx multibytetowidechar to
  12. break, and trace what happens with your string.  I think VB is a bad language
  13. to trace in SoftIce especially for Newbies as VB moves your string around
  14. heaps and calls it's own functions etc which there is no nice API reference
  15. for etc... but anyway, once you remove the layers of VB the protection is
  16. (predicatably) very simple.
  17.  
  18. Btw, if you are getting stuck trying to find the place where the XOR occurs,
  19. the line is 0x4032a0.  First type "addr cm1" , then type bpx 4032a0.  Softice
  20. will break when it reaches that line of code.
  21.  
  22. Another thing is that tracing code is something that comes with experience,
  23. there is no quick and easy way and if c4a are reading this maybe their next
  24. crackme (for newbies) should be in C or something less bloated.  Anyway, I
  25. think most ppl would find the tracing harder than the protection :)
  26.  
  27. Your password is repeatedly XORED with '2000', eg if you entered as a code:
  28.  
  29.                36 37 38 36 37 38 36 37 38
  30.    xor with:   32 30 30 30 32 30 30 30 32
  31.                --------------------------
  32.                04 07 08 06 05 08 06 07 0a
  33.  
  34. At the end we have 04 07 08 06 05 08 06 07 0a (from above).  This is
  35. compared to the string "qBQSYdXUe_B\V", so 678678678 is NOT the right
  36. password in this case :)
  37.  
  38. but we know at the end your code must = qBQSY...
  39.  
  40. thus : q  B  Q  S  Y  d  X  U  e  _  B  \  V (ascii character)
  41.       71 42 51 53 59 64 58 55 65 5f 42 5c 56 (hex value for ascii char)
  42.  
  43. so (char1^0x32)=0x71, (char1=first char of password, ^ = XOR).
  44.  
  45. we know that a ^ b = c and
  46.              c ^ b = a thus
  47.              a = c ^ b (btw a = c ^ b is the same as a = b ^ c)
  48.  
  49. thus, let char1 = a, let 2 = b, and 0x71 = c,
  50.  
  51. from above, a = c ^ b, thus char1 = 0x71 ^ 32, so
  52.                                  char1 = (0x71 ^ 0x32) = 0x43 = 'C'
  53. similarly                        char2 = (0x42 ^ 0x30) = 0x72 = 'r'
  54.                                  char3 = (0x51 ^ 0x30) = 0x61 = 'a'
  55.                                  char4 = (0x53 ^ 0x30) = 0x63 = 'c'
  56.                                  char5 = (0x59 ^ 0x32) = 0x6b = 'k'
  57.                                  char6 = (0x64 ^ 0x30) = 0x54 = 'T'
  58.                                  char7 = (0x58 ^ 0x30) = 0x68 = 'h'
  59.                                  char8 = (0x55 ^ 0x30) = 0x65 = 'e'
  60.  
  61. etc... as an exercise i'll leave it to you to work out the last 5 chars
  62. of the valid code.
  63.  
  64. Incidentally, as with a LOT of VB apps, there is a quick (but braindead) way
  65. of finding your password.  With VB5 there are 2 functions used to compare
  66. strings : __vbastrcmp and __vbastrcomp.  I'm not saying ALL VB apps use
  67. these in their protections, just a lot :).  This CrackMe uses __vbastrcomp.
  68.  
  69. So do a "bpx __vbastrcomp".  Softice will break. DON'T press F11 yet.  First
  70. type DD ESP, which will show you what was pushed to the stack, ie what two
  71. strings are being compared.  Typing dd esp will reveal this in SoftIce:
  72.  
  73. xxxx:yyyyyyyy   aaaaaaaa  bbbbbbbb  cccccccc  dddddddd
  74.  
  75. aaaaaaaa , as with all functions is the return address.
  76. the remaining 'bbbbbbbb' etc are the paramters the function is going to use.
  77. as it happens 'cccccccc' is the address of the good string, and 'dddddddd'
  78. is the address of your modified code (eg 04 07 08 06 05 08 06 07 0a if you
  79. entered 678678678).  Typing "d cccccccc" in softice reveals the code that
  80. your modified code is going to be compared with which is: qBQSYdXUe_B\V.
  81. Because of the nature of this protection, if you type in "qBQSYdXUe_B\V" as
  82. the password, then bpx __vbastrcomp again, and this time type "d dddddddd",
  83. this will reveal the *real* code!
  84.  
  85. Greetz:
  86. ------
  87.  
  88. As usual, out to the #cracking4newbies crew.  For a full list of my greetz
  89. see proph.home.ml.org
  90.  
  91. Conclusion:
  92. ----------
  93.  
  94. A trivial protection, however some good tips for newbies in this tut.
  95.  
  96. -Prophecy.
  97.  
  98. Veni Vedi Veci.
  99.